#include <QApplication>
#include <QDialog>
#include <QPushButton>
#include <QCheckBox>
#include <QRadioButton>
#include <QLineEdit>
#include <QLabel>
#include <QHBoxLayout>
#include <QSpacerItem>
#include <QGridLayout>

int main(int argc, char** argv)
{
	QApplication app(argc, argv);	
	QDialog d(NULL);
	
	QVBoxLayout *vlay_main = new QVBoxLayout();	
	
	QHBoxLayout *hlay_info = new QHBoxLayout();
	
	QGridLayout *glay_fields = new QGridLayout();
	glay_fields->addWidget(new QLabel("Name:"), 0, 0);
	glay_fields->addWidget(new QLineEdit(), 0, 1);
	glay_fields->addWidget(new QLabel("Surname:"), 1, 0);
	glay_fields->addWidget(new QLineEdit(), 1, 1);
	glay_fields->addWidget(new QLabel("Phone:"), 2, 0);
	glay_fields->addWidget(new QLineEdit(), 2, 1);
	glay_fields->addWidget(new QLabel("Address:"), 3, 0);
	glay_fields->addWidget(new QLineEdit(), 3, 1);
	glay_fields->addWidget(new QLabel("Gender:"), 4, 0);
	
	QHBoxLayout *hlay_gender = new QHBoxLayout();
	hlay_gender->addWidget(new QRadioButton("Male"));
	hlay_gender->addWidget(new QRadioButton("Female"));
	glay_fields->addItem(hlay_gender, 4, 1);
	
	hlay_info->addItem(glay_fields);
	hlay_info->addItem(new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Minimum));
	
	QVBoxLayout *vlay_lang = new QVBoxLayout();
	vlay_lang->addWidget(new QLabel("Foreign languages:"));
	vlay_lang->addWidget(new QCheckBox("English", &d));
	vlay_lang->addWidget(new QCheckBox("German", &d));
	vlay_lang->addWidget(new QCheckBox("Frensh", &d));
	vlay_lang->addItem(new QSpacerItem(10, 50, QSizePolicy::Minimum, QSizePolicy::Minimum));
	hlay_info->addItem(vlay_lang);
	
	vlay_main->addItem(hlay_info);
	
	QHBoxLayout *hlay_buttons = new QHBoxLayout();
	
	hlay_buttons->addWidget(new QPushButton("Save data", &d));
	hlay_buttons->addItem(new QSpacerItem(10, 20, QSizePolicy::Maximum, QSizePolicy::Maximum));
	hlay_buttons->addWidget(new QPushButton("Reset data", &d));
	
	vlay_main->addItem(hlay_buttons);	

	d.setLayout(vlay_main);
	
	d.show();	
	return app.exec();
}